#pragma once
#include <pthread.h>
namespace MpthreayMutex
{
    class Mutex
    {
    public:
        Mutex()
        {
            int n = pthread_mutex_init(&_mtx,nullptr);
            (void)n;
        }
        ~Mutex()
        {
            int n = pthread_mutex_destroy(&_mtx);
            (void)n;
        }
        void Lock()
        {
            pthread_mutex_lock(&_mtx);
        }
        void Unlock()
        {
            pthread_mutex_unlock(&_mtx);
        }
    private:
        pthread_mutex_t _mtx;
    };
}

